]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
polkitAgent: Guard against repeated close() calls
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 21 Apr 2018 16:39:10 +0000 (18:39 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 21 Apr 2018 16:42:15 +0000 (18:42 +0200)
We use the close() method to disconnect signal handlers set up in
init(), however the handler ID is only valid in the first call in
case the method is called more than once.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/221

js/ui/components/polkitAgent.js

index 316bc2ad186496041aa3088e636a113b4ac871ef..7a0682c4b17d3dc099da0ce41d1de9390d02d80d 100644 (file)
@@ -201,7 +201,9 @@ var AuthenticationDialog = new Lang.Class({
     close(timestamp) {
         this.parent(timestamp);
 
-        Main.sessionMode.disconnect(this._sessionUpdatedId);
+        if (this._sessionUpdatedId)
+            Main.sessionMode.disconnect(this._sessionUpdatedId);
+        this._sessionUpdatedId = 0;
     },
 
     _ensureOpen() {